/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * jFrPrincipal.java
 *
 * Created on 01/10/2009, 16:56:04
 */

package jbanco;

import java.util.ArrayList;

/**
 *
 * @author Cláudio
 */
public class jFrPrincipal extends javax.swing.JFrame {


    private ArrayList<Cliente> clientes = new ArrayList<Cliente>();
    static ArrayList<Funcionario> Funcionario = new ArrayList<Funcionario>();
    private ArrayList<conta> Conta = new ArrayList<conta>();
    public jFrPrincipal() {
        initComponents();
        setLocationRelativeTo(null);
        Funcionario = new ArrayList<Funcionario>();
        Funcionario.add(new Funcionario("Marcelo","mazini","teste",TipoFunc.Usuario));
        Funcionario.add(new Funcionario("Cláudio","claudio","teste",TipoFunc.Administrador));
    }


    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jBtnContas = new javax.swing.JButton();
        jBtnFuncionario = new javax.swing.JButton();
        jBtnClientes = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setResizable(false);

        jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLabel1.setFont(new java.awt.Font("Calibri", 1, 18));
        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jbanco/logobanco.png"))); // NOI18N
        jLabel1.setText("jBanco 0.5");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Opções", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Calibri", 0, 12))); // NOI18N

        jBtnContas.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jbanco/coins-128x128.png"))); // NOI18N
        jBtnContas.setText("Contas");
        jBtnContas.setMaximumSize(new java.awt.Dimension(129, 41));
        jBtnContas.setMinimumSize(new java.awt.Dimension(129, 41));
        jBtnContas.setPreferredSize(new java.awt.Dimension(129, 41));
        jBtnContas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnContasActionPerformed(evt);
            }
        });

        jBtnFuncionario.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jbanco/clientes32x32.png"))); // NOI18N
        jBtnFuncionario.setText("Funcionários");
        jBtnFuncionario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnFuncionarioActionPerformed(evt);
            }
        });

        jBtnClientes.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jbanco/usuario.png"))); // NOI18N
        jBtnClientes.setText("Clientes");
        jBtnClientes.setMaximumSize(new java.awt.Dimension(129, 41));
        jBtnClientes.setMinimumSize(new java.awt.Dimension(129, 41));
        jBtnClientes.setPreferredSize(new java.awt.Dimension(129, 41));
        jBtnClientes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnClientesActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jBtnContas, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jBtnFuncionario)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jBtnClientes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(21, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addGap(29, 29, 29)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jBtnFuncionario, javax.swing.GroupLayout.DEFAULT_SIZE, 58, Short.MAX_VALUE)
                    .addComponent(jBtnContas, javax.swing.GroupLayout.DEFAULT_SIZE, 58, Short.MAX_VALUE)
                    .addComponent(jBtnClientes, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(22, 22, 22))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(72, 72, 72)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(39, 39, 39))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jBtnFuncionarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnFuncionarioActionPerformed
        // TODO add your handling code here:
        Funcionario();
    }//GEN-LAST:event_jBtnFuncionarioActionPerformed

    private void jBtnClientesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnClientesActionPerformed
        Clientes();
    }//GEN-LAST:event_jBtnClientesActionPerformed

    private void jBtnContasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnContasActionPerformed
        Conta();
    }//GEN-LAST:event_jBtnContasActionPerformed

// <editor-fold defaultstate="collapsed" desc="Métodos Privados">
    private void Conta() {
        jFrConta jfr = new jFrConta(Conta, clientes);
        jfr.setVisible(true);
        jfr.setLocationRelativeTo(this);
    }

    private void Clientes() {
        jrfClientes jrf = new jrfClientes(clientes);
        jrf.setVisible(true);
        jrf.setLocationRelativeTo(this);
    }

    private void Funcionario() {
        jFrFuncionario jrf = new jFrFuncionario(Funcionario);
        jrf.setVisible(true);
        jrf.setLocationRelativeTo(this);
    }// </editor-fold>
    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                jFrPrincipal jrfPrincipal = new jFrPrincipal();                
                jrfPrincipal.setVisible(true);
                jFrLogin jrf = new jFrLogin(jrfPrincipal, true, Funcionario);
                jrf.setLocationRelativeTo(jrfPrincipal);
                jrf.setVisible(true);
            }

        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jBtnClientes;
    private javax.swing.JButton jBtnContas;
    private javax.swing.JButton jBtnFuncionario;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    // End of variables declaration//GEN-END:variables

}
